package com.websuites.ejb.jndi;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.websuites.utils.LogUtil;

public class GlassfishJNDIFinderImpl implements JNDIFinder {  
	 public Object lookup(InitialContext ctx, String serviceClass){   
	        try {
	        	return ctx.lookup(serviceClass);
			} catch (NamingException e) {
				LogUtil.error("can not lookup ejb service '"+serviceClass);
				LogUtil.error(e.getStackTrace());
			}
			return null;  
	    }
	    
	    public Object lookupJNDI(InitialContext ctx, String jndi){   
	        try {
				return ctx.lookup(jndi);
			} catch (NamingException e) {
				LogUtil.error("can not lookup jndi: '"+jndi +"'");
				LogUtil.error(e.getStackTrace());
			}
			return null;  
	    }
}  